package com.xzbd.gef.model;

import org.eclipse.draw2d.geometry.Rectangle;

import com.xzbd.gef.model.connection.ConnectionPort;
import com.xzbd.listeners.PropListener;

public class BusPortSwitch  extends ConnectionPort{
	
	private static final long serialVersionUID = 1L;
	
	public static final String PROPERTY_PORTTYPE = "porttype";
	private String portType = "Unknown";
	
	public BusPortSwitch(){
	}
	
	public String getPortType() {
		return portType;
	}

	public void setPortType(String portType) {
		String oldPortType = this.portType;
		this.portType = portType;
		getListeners().firePropertyChange(PropListener.PROPERTY_RENAME, oldPortType, this.portType);
	}
	
	@Override
	public Object clone() throws CloneNotSupportedException {
		BusPortSwitch emp = new BusPortSwitch();
		emp.setName(this.getName());
		emp.setParent(this.getParent());
		emp.setPortType(this.portType);
		emp.setLayout(new Rectangle(getLayout().x+10, getLayout().y+10,getLayout().width,getLayout().height));
		return emp;
	}

}
